function g1 = static_g1(T, y, x, params, T_flag)
% function g1 = static_g1(T, y, x, params, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T         [#temp variables by 1]  double   vector of temporary terms to be filled by function
%   y         [M_.endo_nbr by 1]      double   vector of endogenous variables in declaration order
%   x         [M_.exo_nbr by 1]       double   vector of exogenous variables in declaration order
%   params    [M_.param_nbr by 1]     double   vector of parameter values in declaration order
%                                              to evaluate the model
%   T_flag    boolean                 boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = modelG.static_g1_tt(T, y, x, params);
end
g1 = zeros(20, 20);
g1(1,4)=(-(params(4)*(1-params(3))));
g1(1,6)=params(1);
g1(1,10)=(-(params(3)*T(1)*(-params(13))*(1-T(1))));
g1(1,15)=(-(params(1)-params(4)*(1-params(3))));
g1(2,5)=(-((1-params(3))*(1-params(4))));
g1(2,7)=1-params(1);
g1(2,10)=(-(T(1)*params(3)*params(13)*(1-T(1))));
g1(2,15)=(-(params(3)*(1-T(1))));
g1(3,6)=(-((1-params(11))*(1-params(11)*params(9))*params(8)));
g1(3,8)=params(11)-params(11)*params(9);
g1(3,10)=(-((1-params(11))*(1-params(11)*params(9))*(-(1-T(1)))));
g1(3,15)=(-((1-params(11))*(1-params(11)*params(9))*params(7)));
g1(4,7)=(-(params(8)*(1-params(12))*(1-params(9)*params(12))));
g1(4,9)=params(12)-params(9)*params(12);
g1(4,10)=(-(T(1)*(1-params(12))*(1-params(9)*params(12))));
g1(4,15)=(-(params(7)*(1-params(12))*(1-params(9)*params(12))));
g1(5,14)=(-params(14));
g1(5,20)=params(10);
g1(6,14)=1;
g1(6,20)=(-1);
g1(7,8)=(-T(1));
g1(7,9)=(-(1-T(1)));
g1(7,20)=1;
g1(8,8)=(-params(1));
g1(8,9)=(-(1-params(1)));
g1(8,13)=1;
g1(9,6)=(-params(1));
g1(9,7)=(-(1-params(1)));
g1(9,11)=1;
g1(10,4)=(-params(4));
g1(10,5)=(-(1-params(4)));
g1(10,12)=1;
g1(11,8)=(-1);
g1(11,9)=1;
g1(12,2)=1-params(5);
g1(13,3)=1-params(6);
g1(14,2)=(-0.16);
g1(14,4)=1;
g1(15,3)=(-0.16);
g1(15,5)=1;
g1(16,1)=1;
g1(16,2)=(-1);
g1(16,3)=(-1);
g1(17,9)=1;
g1(18,8)=1;
g1(19,20)=1;
g1(20,12)=(-params(2));
g1(20,19)=1;
if ~isreal(g1)
    g1 = real(g1)+2*imag(g1);
end
end
